package io.geekidea.springbootplus.system.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.apache.ibatis.annotations.Param;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * <pre>
 * 会员信息
 * </pre>
 *
 * @author geekidea
 * @since 2019-10-24
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "SysMember对象", description = "会员信息")
public class SysMember extends BaseEntity{
  private static final long serialVersionUID = -912347992199193768L;

  @ApiModelProperty("主键")
  @TableId(value = "id", type = IdType.AUTO)
  @NotNull(groups = Update.class, message = "会员ID不能为空")
  private Long id;

  @ApiModelProperty("授权用户唯一标识")
  private String openid;

  @ApiModelProperty("会员昵称")
  private String nickName;

  @ApiModelProperty("电子邮箱")
  private String email;

  @ApiModelProperty("手机号码")
  private String phone;

  @ApiModelProperty("会员积分,与赠送的积分gift_point相关联")
  private Integer integral;

  @ApiModelProperty("会员折扣率 0.00~1.00之间，默认不打折")
  private double discount;

  @ApiModelProperty("余额")
  private BigDecimal balance;

  @ApiModelProperty("说明")
  private String description;

  @ApiModelProperty("会员卡号")
  private String cardNumber;

  @ApiModelProperty("头像地址")
  private String avatarUrl;

  @ApiModelProperty("性别")
  private Integer gender;

  @ApiModelProperty("创建时间")
  @Null(message = "创建时间不用传")
  private LocalDateTime createdTime;

  @ApiModelProperty("会员删除标记")
  private Integer deleted;

 /* @ApiModelProperty("最后登录IP")
  private String LoginIp;

  @ApiModelProperty("会话密钥")
  private String sessionKey;

  @ApiModelProperty("最后登录时间")
  @Null(message = "最后登录时间不用传")
  private LocalDateTime loginTime;*/

}
